package test;

import java.util.concurrent.atomic.AtomicInteger;

public class MyRunnable2 implements Runnable {
    private AtomicInteger number = new AtomicInteger();
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            //每次修改加锁

                System.out.println(Thread.currentThread().getName() +"number ========== " + number.incrementAndGet());

        }

    }

}
